import 'package:custom_widgets/item_normal_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ui_demo/page/component/tricks/annotated_region_page.dart';
import 'package:flutter_ui_demo/res/strings.dart';

import 'tricks/animated-lists-in-flutter.dart';
import 'tricks/animating-position-changes-in-flutter.dart';
import 'tricks/animating-widgets-with-ease-in-flutter.dart';
import 'tricks/circular-progress-indicator-with-percentage-in-flutter.dart';
import 'tricks/color-filters-in-flutter.dart';
import 'tricks/commodore-64-screen-in-flutter.dart';
import 'tricks/custom-clippers-in-flutter.dart';
import 'tricks/custom-path-clippers-in-flutter.dart';
import 'tricks/dismissing-list-items-in-flutter.dart';
import 'tricks/displaying-cupertino-action-sheets-in-flutter.dart';
import 'tricks/displaying-scroll-wheels-in-flutter.dart';
import 'tricks/expansion-panels-and-lists-in-flutter.dart';
import 'tricks/fade-between-widgets-in-flutter.dart';
import 'tricks/flinging_rotation_button.dart';
import 'tricks/frost-effect-on-images-in-flutter.dart';
import 'tricks/generic_dialog_page.dart';
import 'tricks/image-tint-in-flutter.dart';
import 'tricks/implementing-drag-and-drop-in-flutter.dart';
import 'tricks/move-widget-shadows-with-animation.dart';
import 'tricks/multiline_textfields.dart';
import 'tricks/orientationbuilder_page.dart';
import 'tricks/placing-constraints-on-widgets-in-flutter.dart';
import 'tricks/reordering-items-inside-list-views-in-flutter.dart';
import 'tricks/throttling_button.dart';
import 'tricks/transitioning-between-widgets-in-flutter.dart';
import 'tricks/computOrisolate.dart';
import 'tricks/multiple-gradients-in-container-in-flutter.dart';
import 'tricks/shakeAnimation.dart';
import 'tricks/slidetransition-in-flutter.dart';

// 定义到方法前,不允许重写
// @mustCallSuper

// 定义到类前,子类是不可变的
// @immutable

// 继承 Comparable类可以重写 ==

// IterableMixin 自定义类的List链

// 抽象类的构造方法必须被继承

class ComponentPage extends StatefulWidget {
  ComponentPage({Key? key}) : super(key: key);

  @override
  _ComponentPageState createState() => _ComponentPageState();
}

class _ComponentPageState extends State<ComponentPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(AppStrings.TAB_COMPONENT),
        centerTitle: true,
        elevation: 0.5,
      ),
      body: ListView(
        children: <Widget>[
          ItemNormalWidget.item(
            title: "ComputOrIsolate",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => ComputOrIsolatePage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "ShakeAnimation",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => ShakeAnimationPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "MultipleGradients",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => MultipleGradientsPage(),
                    // 基础路由参数传递
                    settings: RouteSettings(
                        name: "name", arguments: "Argument Value")),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "slidetransition",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => SlideransitionPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "ImageTintPage",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => ImageTintPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "EXpansionPanelsPage",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => EXpansionPanelsPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "CircularProgress",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => CircularProgressPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "Commodore64Page",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => Commodore64Page()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "AnimatedLists",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => AnimatedListsPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "MoveWidgetShadows",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => MoveWidgetShadowsPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "CustomPath",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => CustomPathPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "FrostEffect",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => FrostEffectPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "CustomClippers",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => CustomClippersPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "DisplayintScrollWheels滚动试图",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => DisplayintScrollWheelsPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "CupertinoAction",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => CupertinoActionPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "ColorFilter颜色滤镜",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => ColorFilterPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "FadeBetween切换动画",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => FadeBetweenPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "手势缩放",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => PlacingConstraintsPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "Position动画",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => AnimatingPositionPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "Between动画",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => TransitionBetweenPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "拖动排序",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => ReorderInsideListPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "拖拽至指定区域Draggable",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => ImplementDragDropPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "滑动删除Dismissible",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => DismissingListItemsPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "旋转动画Ease",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => AnimatingEasePage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "文本框高度自适应",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => MultilineTextFields()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "点击事件节流",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => ThrottlingButton()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "按钮Flinging旋转",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => FlingingRotationButton()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "旋转后改动布局",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => OrientationBuilderPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "Generic Dialog",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => GenericDialogPage()),
              );
            },
          ),
          ItemNormalWidget.item(
            title: "Annotated Region",
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => AnnotatedRegionPage()),
              );
            },
          ),
        ],
      ),
    );
  }
}
